package gui.data.D3;

import java.awt.Dimension;
import java.awt.GridLayout;

import gui.MyFrame;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class SphereOutputGui extends JPanel {

	JLabel areaLbl, volumeLbl, circumferenceLbl, radiusLbl, capVolumeLbl,
			capAreaLbl, capCircumferenceLbl, capRadiusLbl, capHeightLbl;
	JTextField areaInput, volumeInput, circumferenceInput, radiusInput,
			capVolumeInput, capAreaInput, capCircumferenceInput,
			capRadiusInput, capHeightInput;
	MyFrame myFrame;

	public SphereOutputGui(double volume, double area, double circumference,
			double radius, double capVolume, double capArea,
			double capCircumference, double capRadius, double capHeight) {
		this.myFrame = myFrame;
		this.setLayout(new GridLayout(10, 2));
		this.setPreferredSize(new Dimension(500, 500));
		volumeLbl = new JLabel("Volume = ");
		circumferenceLbl = new JLabel("Circumference = ");
		capAreaLbl = new JLabel("Cap area = ");
		areaLbl = new JLabel("Area = ");
		capHeightLbl = new JLabel("Cap height = ");
		radiusLbl = new JLabel("Radius = ");
		capRadiusLbl = new JLabel("Cap radius = ");
		capCircumferenceLbl = new JLabel("Cap circumference = ");
		capVolumeLbl = new JLabel("Cap Volume = ");
		volumeInput = new JTextField(volume == 0 ? "N/A" : "" + volume);
		circumferenceInput = new JTextField(circumference == 0 ? "N/A" : ""
				+ circumference);
		capAreaInput = new JTextField(capArea == 0 ? "N/A" : "" + capArea);
		areaInput = new JTextField(area == 0 ? "N/A" : "" + area);
		capHeightInput = new JTextField(capHeight == 0 ? "N/A" : "" + capHeight);
		radiusInput = new JTextField(radius == 0 ? "N/A" : "" + radius);
		capRadiusInput = new JTextField(capRadius == 0 ? "N/A" : "" + capRadius);
		capCircumferenceInput = new JTextField(capCircumference == 0 ? "N/A"
				: "" + capCircumference);
		capVolumeInput = new JTextField(capVolume == 0 ? "N/A" : "" + capVolume);
		this.add(radiusLbl);
		this.add(radiusInput);
		this.add(circumferenceLbl);
		this.add(circumferenceInput);
		this.add(areaLbl);
		this.add(areaInput);
		this.add(volumeLbl);
		this.add(volumeInput);
		this.add(capRadiusLbl);
		this.add(capRadiusInput);
		this.add(capHeightLbl);
		this.add(capHeightInput);
		this.add(capCircumferenceLbl);
		this.add(capCircumferenceInput);
		this.add(capAreaLbl);
		this.add(capAreaInput);
		this.add(capVolumeLbl);
		this.add(capVolumeInput);
		areaInput.setEditable(false);
		volumeInput.setEditable(false);
		circumferenceInput.setEditable(false);
		radiusInput.setEditable(false);
		capVolumeInput.setEditable(false);
		capAreaInput.setEditable(false);
		capCircumferenceInput.setEditable(false);
		capRadiusInput.setEditable(false);
		capHeightInput.setEditable(false);
		this.add(new JLabel());
	}

}
